
package com.compuvest.web;

public class Item implements java.io.Serializable {

    // warranty
    public final static int WARRANTY_NONE =	0;	// 0000 0000
    public final static int WARRANTY_30D =	0x1;	// 0000 0001
    public final static int WARRANTY_60D =	0x1<<1; // 0000 0010
    public final static int WARRANTY_90D =	0x1<<2; // 0000 0100
    public final static int WARRANTY_180D =	0x1<<3; // 0000 1000
    public final static int WARRANTY_1Y =	0x1<<4; // 0001 0000
    public final static int WARRANTY_3Y =	0x1<<5; // 0010 0000
    public final static int WARRANTY_5Y =	0x1<<6; // 0100 0000
    public final static int WARRANTY_LIFE =	0x1<<7; // 1000 0000

    public final static int MANUFACTURE_W30D =	0x1<<8;	// 0000 0001 0000 0000
    public final static int MANUFACTURE_W45D =	0x1<<9; // 0000 0010 0000 0000
//    public final static int MANUFACTURE_W90D =	0x1<<10;// 0000 0100 0000 0000
    public final static int MANUFACTURE_W180D =	0x1<<11;// 0000 1000 0000 0000
    public final static int MANUFACTURE_W1Y =	0x1<<12;// 0001 0000 0000 0000
    public final static int MANUFACTURE_W3Y =	0x1<<13;// 0010 0000 0000 0000
    public final static int MANUFACTURE_W5Y =	0x1<<14;// 0100 0000 0000 0000

    public final static int EXTENDED_WARRANTY    = 0x00FF; // 1111 1111 select extended warranty
    public final static int MANUFACTURE_WARRANTY = 0xFF00; // 1111 1111 0000 0000 select manufacture warranty

    public final static String W30DAYS =	"30 Days";
    public final static String W45DAYS =	"45 Days";
    public final static String W60DAYS =	"60 Days";
    public final static String W90DAYS =	"90 Days";
    public final static String W180DAYS =	"180 Days";
    public final static String W1YEAR =		"1 Year";
    public final static String W3YEARS =	"3 Years";
    public final static String W5YEARS =	"5 Years";
    public final static String WLIFETIME =	"Life Time";

    private int itemID = 0;
    private int itemIDR = 0;
    private int categoryID = 0;
    private String itemName = "";
    private String accwareCode = "";
    private String categoryName = "";
    private String subcatName = "";
    private int categoryParent = 0;
    private String description = "";
    private double price = 0d;
    private double priceR = 0d;
    private double resPrice1 = 0d;
    private double resPrice2 = 0d;
    private double resPrice3 = 0d;
    private int resQuantity2 = 0;
    private int resQuantity3 = 0;
    private int quantity = 0;
    private int quantityR = 0;
    private boolean stock = false;
    private boolean stockR = false;
    private String status = "";
    private double weight = 0d;
    private String mfrName = "";
    private String mfrNumber = "";
    private String mfrLink = null;
    private String condition = "";
    private String packages = null;
    private String packagesInclude = null;
    private String comments = "";
    private int bannerMask = 0;
    private int warrantyMask = 0;
    private double warranty1 = 0d;
    private double warranty2 = 0d;
    private double warranty3 = 0d;

    public Item() {
	this(0, 0, "", 0d, "", 0);
    }

    public Item(int itemID, int categoryID, String itemName, double sellPrice, String accwareCode, int categoryParentID) {
	this.itemID = itemID;
	this.categoryID = categoryID;
	this.itemName = itemName;
	this.price = sellPrice;
	this.accwareCode = accwareCode;
	this.categoryParent = categoryParentID;
    }

    public int getItemID()				{ return itemID; }
    public void setItemID(int itemID)			{ this.itemID = itemID; }

    public int getItemIDR()				{ return itemIDR; }
    public void setItemIDR(int itemIDR)			{ this.itemIDR = itemIDR; }

    public int getCategoryID()				{ return categoryID; }
    public void setCategoryID(int categoryID)		{ this.categoryID = categoryID; }

    public String getItemName()				{ return itemName; }
    public void setItemName(String itemName)		{ this.itemName = itemName; }

    public String getAccwareCode()			{ return accwareCode; }
    public void setAccwareCode(String accwareCode)	{ this.accwareCode = accwareCode; }

    @Deprecated
    public String getCategoryName()			{ return categoryName; }
    @Deprecated
    public void setCategoryName(String categoryName)	{ this.categoryName = categoryName; }

    @Deprecated
    public int getCategoryParent()			{ return categoryParent; }
    @Deprecated
    public void setCategoryParent(int categoryParent)	{ this.categoryParent = categoryParent; }

    @Deprecated
    public String getSubcategoryName()			{ return subcatName; }
    @Deprecated
    public void setSubcategoryName(String subcatName)	{ this.subcatName = subcatName; }

    public String getDescription()			{ return description; }
    public void setDescription(String description)	{ this.description = description; }

    public double getPrice()				{ return price; }
    public void setPrice(double price)			{ this.price = price; }

    @Deprecated
    public double getPriceR()				{ return priceR; }
    @Deprecated
    public void setPriceR(double priceR)		{ this.priceR = priceR; }

    public double getResPrice1()			{ return resPrice1; }
    public void setResPrice1(double price1)		{ this.resPrice1 = price1; }

    public double getResPrice2()			{ return resPrice2; }
    public void setResPrice2(double price2)		{ this.resPrice2 = price2; }

    public double getResPrice3()			{ return resPrice3; }
    public void setResPrice3(double price3)		{ this.resPrice3 = price3; }

    public int getResQuantity2()			{ return resQuantity2; }
    public void setResQuantity2(int quantity2)		{ this.resQuantity2 = quantity2; }

    public int getResQuantity3()			{ return resQuantity3; }
    public void setResQuantity3(int quantity3)		{ this.resQuantity3 = quantity3; }

    public int getQuantity()				{ return quantity; }
    public void setQuantity(int quantity)		{ this.quantity = quantity; }

    @Deprecated
    public int getQuantityR()				{ return quantityR; }
    @Deprecated
    public void setQuantityR(int quantityR)		{ this.quantityR = quantityR; }

    public boolean getStock()				{ return stock; }
    public void setStock(boolean stock)			{ this.stock = stock; }

    @Deprecated
    public boolean getStockR()				{ return stockR; }
    @Deprecated
    public void setStockR(boolean stockR)		{ this.stockR = stockR; }

    public String getStatus()				{ return status; }
    public void setStatus(String status)		{ this.status = status; }

    public double getWeight()				{ return (weight == 0.0)? 0.1: weight; }
    public void setWeight(double weight)		{ this.weight = weight; }

    public String getMfrName()				{ return mfrName; }
    public void setMfrName(String mfrName)		{ this.mfrName = mfrName; }

    public String getMfrNumber()			{ return mfrNumber; }
    public void setMfrNumber(String mfrNumber)		{ this.mfrNumber = mfrNumber; }

    public String getMfrLink()				{ return mfrLink; }
    public void setMfrLink(String mfrLink)		{ this.mfrLink = mfrLink; }

    public String getCondition()			{ return condition; }
    public void setCondition(String condition)		{ this.condition = condition; }

    public String getPackage()				{ return packages; }
    public void setPackage(String packages)		{ this.packages = packages; }

    public String getPackageInclude()			 { return packagesInclude; }
    public void setPackageInclude(String packagesInclude){ this.packagesInclude = packagesInclude; }

    public String getComments()				{ return comments; }
    public void setComments(String comments)		{ this.comments = comments; }

    public int getBannerMask()				{ return bannerMask; }
    public void setBannerMask(int bannerMask)		{ this.bannerMask = bannerMask; }

    public int getWarrantyMask()			{ return warrantyMask; }
    public void setWarrantyMask(int warrantyMask)	{ this.warrantyMask = warrantyMask; }

    public double getWarrantyPrice1()			{ return warranty1; }
    public void setWarrantyPrice1(double warranty1)	{ this.warranty1 = warranty1; }

    public double getWarrantyPrice2()			{ return warranty2; }
    public void setWarrantyPrice2(double warranty2)	{ this.warranty2 = warranty2; }

    public double getWarrantyPrice3()			{ return warranty3; }
    public void setWarrantyPrice3(double warranty3)	{ this.warranty3 = warranty3; }

    @Override
    public String toString() {
	 return "id=" + itemID;
    }
}
